#include <stdio.h>
#include <string.h>
#include "hmacsha256.h"

void main()
{
	char key[1024], buf[1024], digest[20], hex[41];
	struct HmacSha256Context hmac;
	while (1)
	{
		gets(key);
		gets(buf);
		printf("HMAC-SHA256(key=\"%s\", data=\"%s\")= ", key, buf);
		HmacSha256Init(&hmac, key, strlen(key));
		HmacSha256Update(&hmac, buf, strlen(buf));
		HmacSha256Final(digest, &hmac);
		HmacSha256HexString(hex, digest);
		printf("HEX %s\n", hex);
	}
}

